package com.ruoyi.common.utils;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.Random;
import java.util.concurrent.atomic.AtomicInteger;

public class SerialNo {

    //订单编号
    public static String generateOrderNumber() {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
        String timestamp = sdf.format(new Date());
        int randomNum = new Random().nextInt(1000);
        return "333"+timestamp + String.format("%03d", randomNum);
    }


    public static void main(String[] args) {
        System.out.println(generateOrderNumber());
    }

}

